import React, { memo } from 'react'
import routes from './routes.config';

function ShouYe(props) {

    const goToSelf = (path) => {
        props.history.push(path);

    }

    const renderList = () => {
        return routes.map((route, index) => {
            return (
                <h1 key={index} onClick={() => goToSelf(route.path)}><a>{route.name}</a></h1>
            )
        })
    }

    return (
        <>
            { renderList() }
        </>
    )
}
export default memo(ShouYe);